package com.cr.web.controller.lsd;

import com.cr.common.core.domain.AjaxResult;
import com.cr.sync.domain.dto.LsdCountParam;
import com.cr.sync.service.ITbSyncAgriculturalProductLandmarkService;
import com.cr.sync.service.ITbSyncBrandProductService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * 大屏特色产品信息控制器
 */
@RestController
@RequestMapping("/lsd/product")
public class LsdFeaturedProductsController {

    @Resource
    private ITbSyncAgriculturalProductLandmarkService agriculturalProductLandmarkService;

    @Resource
    private ITbSyncBrandProductService brandProductService;

    /**
     * 绿色有机产品列表查询
     */
    @GetMapping("lsyj")
    public AjaxResult lsyj(@Valid LsdCountParam param){
        return AjaxResult.success(brandProductService.getLsyj(param));
    }

    /**
     * 产品地理标志查询
     * @param param 参数
     */
    @GetMapping("landmark")
    public AjaxResult landmark(@Valid LsdCountParam param){
        return AjaxResult.success(agriculturalProductLandmarkService.getAgriculturalProductLandmarkList(param));
    }

    /**
     * 名特优新产品列表查询
     */
    @GetMapping("mtyx")
    public AjaxResult mtyx(@Valid LsdCountParam param){
        return AjaxResult.success(brandProductService.getMtyx(param));
    }

}
